package com.ihrm.system.feign;

import com.ihrm.common.entity.Result;
import com.ihrm.domain.company.Department;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author 小伟
 * @version V1.0
 * @Package com.ihrm.system.feign
 * @date 2021/1/9 15:32
 * @Copyright © 2020-2021 郑州恒星科技有限责任公司
 * 调用企业微服务中的接口
 */

/**
 * 设置微服务名称
 * @author Jackey
 */
@FeignClient(value = "ihrm-company")
public interface DepartmentFeignClient {
    /**
     * 根据部门id查询部门信息
     * @param id
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/company/department/{id}/", method = RequestMethod.GET)
    Result findById(@PathVariable String id) throws Exception;

    /**
     * 根据部门编号和企业id查询部门信息
     * @param code      部门编号
     * @param companyId 企业id
     * @return 部门对象
     */
    @RequestMapping(value="/company/department/search",method = RequestMethod.POST)
    Department findByCode(@RequestParam(value="code") String code, @RequestParam(value="companyId") String companyId);
}
